<?php

namespace App\Http\Requests\Logic\Schedule;

use Illuminate\Foundation\Http\FormRequest;

class StoreResource extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * 定义表单验证规则
     *
     * Date: 21/04/2018
     * @author George
     * @return array
     */
    public function rules()
    {
        return [
        	'project_id' => 'required',
        	'demand_id' => 'required',
        	'users_id' => 'required|array',
        ];
    }

    /**
     * 定义表单验证错误消息
     *
     * Date: 21/04/2018
     * @author George
     * @return array
     */
    public function messages()
    {
        return [
            'project_id.required' => '缺少项目ID',
            'demand_id.required' => '缺少用人需求ID',
            'users_id.required' => '缺少用户ID'
        ];
    }
}
